// pages/component/header/header.js

const app = getApp()

Component({
  /**
   * 组件的属性列表
   */
  properties: {
    name: String,
    state: Boolean
  },
  ready: function () {
    wx.request({
      url: app.globalData.url + 'ziyu.php?Action=touch_ad=ctype', //首页图标
      success: function (res) {
      },
    })
  },
  /**
   * 组件的初始数据
   */
  data: {
    phoneList: [
      {
        name: '首页',
        url: '../index/index'
      },
      {
        name: '产品分类',
        url: '../productSort/productSort'
      },
      {
        name: '行情参考',
        url: '../market/market'
      },
      {
        name: '指数变动',
        url: '../exponentChange/exponentChange'
      },
      {
        name: '品牌批发',
        url: '../wholesale/wholesale'
      },
      {
        name: '资讯频道',
        url: '../newsList/newsList'
      },
      {
        name: '公司简介',
        url: '../abouts/abouts'
      },
      {
        name: '我的',
        url: '../my/my'
      },
    ],
    phoneState: false
  },

  /**
   * 组件的方法列表
   */
  methods: {
    switchMenu() {
      this.setData({
        phoneState: !this.data.phoneState
      })
    },
    back() {
      wx.reLaunch({
        url: '../index/index'
      })
    },
    toLink(e) {
      wx.reLaunch({
        url: e.currentTarget.dataset.url
      })
    }
  }
})
